<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            width: 300px;
            height: 300px;
            background: red;
            position: fixed;
            left: 0px;
            bottom: 0px;
        }

        .box span {
            display: block;
            float: right;
        }
    </style>
</head>

<body>
    <div class="box">
        <span class="close">X</span>
    </div>
    <script>
        var boxEle = document.querySelector(".box");
        var closeEle = document.querySelector(".close");

        var flag = true; // 代表广告显示状态；
        closeEle.onclick = function () {
            boxEle.style.display = "none";
            flag= false;  //关闭状态；
            if(!flag){
                setTimeout(function(){
                    boxEle.style.display = "block";
                }, 1000);
            }
        }



    </script>
</body>

</html>